
	
/*
 * 自动计算表单数据
 */
function calFormItem() {
    var domForm = $('#' + window.formObj.c.id_form);
	var basicSalary = parseFloat(domForm.find('input[name="basicSalary"]').val()); // 基本底薪
	var positionSalary = parseFloat(domForm.find('input[name="positionSalary"]').val()); // 岗位薪资
	var perbasedSalary = parseFloat(domForm.find('input[name="perbasedSalary"]').val()); // 绩效薪资
	var transSubsidy = parseFloat(domForm.find('input[name="transSubsidy"]').val()); // 交通补贴
	var cateringSubsidy = parseFloat(domForm.find('input[name="cateringSubsidy"]').val()); // 餐饮补贴
	var jobPromotion = parseFloat(domForm.find('input[name="jobPromotion"]').val()); // 岗位提奖/月
	var quarterlyBonus = parseFloat(domForm.find('input[name="quarterlyBonus"]').val()); // 季度提奖
	var annualBonus = parseFloat(domForm.find('input[name="annualBonus"]').val()); // 年终奖标准

	if((basicSalary || basicSalary == 0)
		&& (positionSalary || positionSalary == 0)
		&& (perbasedSalary || perbasedSalary == 0)
		&& (transSubsidy || transSubsidy == 0)
		&& (cateringSubsidy || cateringSubsidy == 0)
		&& (jobPromotion || jobPromotion == 0)
		&& (quarterlyBonus || quarterlyBonus == 0)
		&& (annualBonus || annualBonus == 0)) {
		// 发薪标准 = 基本底薪/月+岗位薪资/月+绩效薪资/月+交通补贴/月+餐饮补贴/月+岗位提奖/月
		var salaryStandard = basicSalary + positionSalary + perbasedSalary + transSubsidy + cateringSubsidy + jobPromotion ;
		domForm.find('input[name="salaryStandard"]').val(salaryStandard);
		
		// 定薪标准 = 发薪标准/月+季度提奖/月
		var fixsalaryStandard = salaryStandard + quarterlyBonus;
		domForm.find('input[name="fixsalaryStandard"]').val(fixsalaryStandard);
		
		// 固定薪资比例 = （基本底薪/月+岗位薪资/月）/发薪标准/月
		var fixedSalaryRatio = ((basicSalary + positionSalary) / salaryStandard * 100).toFixed(2);

		if(salaryStandard == 0){
			fixedSalaryRatio =0;
		}
		domForm.find('input[name="fixedSalaryRatio"]').val(fixedSalaryRatio);
		// 绩效薪资比例 = （绩效薪资/月+交通补贴/月+餐饮补贴/月）/发薪标准/月
		var performanceRatio =((perbasedSalary + transSubsidy + cateringSubsidy) / salaryStandard * 100).toFixed(2);
		if(salaryStandard == 0){
			performanceRatio =0;
		}
		domForm.find('input[name="performanceRatio"]').val(performanceRatio);

	}
}